<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
    <head>
        <meta charset="utf-8">
        <title>
            	
        </title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="format-detection" content="telephone=no">
        <link rel="stylesheet" href="/houtaistatic/css/x-admin.css" media="all">
        <style type="text/css">
            /*设置 a 标签的css样式*/

            .page-normal a {
                border: 1px solid #ff6500;
                padding: 5px 7px;
                color: #ff6500;
                margin-left: 20px;
                /*设置标签 a 之间的间隔*/
                text-decoration: none;
                /*去除页码数字下面的下划线*/
            }
            /*设置鼠标经过时 a 标签的css样式*/

            .page-normal a:hover {
                background-color: #ffbe94;
            }
            /*设置整个div的css样式,该样式主要用于设置网页内的省略号 …… 的样式，并且同时设置内容居中显示*/

            .page-normal {
                color: #ff6500;
                text-align: center;
            }
            /*设置当前页面的css样式*/

            .page-normal .page-current {
                color: #ffffff;
                background-color: #ff6500;
            }
            /*设置左单括号 < 的css样式*/

            .page-normal .page-prev {
                color: #ffe3c6;
            }
            /*进行代码优化，将不同css样式中共有的属性放在一起，有助于提高运行效率*/

            .page-normal a,
            .page-normal a:hover,
            .page-normal .page-prev,
            .page-normal .page-current {
                border: 1px solid #ff6500;
                padding: 5px 7px;
            }
        </style>
    </head>


    <script src="/houtaistatic/js/jquery.min.js" type="text/javascript"></script>
 <!--   使用ajax异步刷新技术-->
    <script type="text/javascript">

    </script>
    <body>
        <div class="x-nav">
            <span class="layui-breadcrumb">
              <a><cite>首页</cite></a>
              <a><cite>旅游类型管理</cite></a>
              <a><cite>行程管理</cite></a>
            </span>
            <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"  href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon" style="line-height:30px">ဂ</i></a>
        </div>
        <div class="x-body">
            <form class="layui-form x-center" style="width:800px;margin-left: 0px;padding-left: 100px" action="/routeJb/houtailist">
                <div class="layui-form-pane" style="margin-top: 15px;">
                    <div class="layui-form-item" style="width: 1000px;">
                        <label class="layui-form-label">商家ID</label>
                        <div class="layui-input-inline">
                            <input type="text" name="mId"  id="mId"  placeholder="请输入商家ID" autocomplete="off" class="layui-input" th:value="${routeJb.mId}">
                        </div>
                        <label class="layui-form-label">商家名称</label>
                        <div class="layui-input-inline">
                            <input type="text" name="proName"  id="proName"  placeholder="请输入商家名称" autocomplete="off" class="layui-input" th:value="${routeJb.proName}">
                        </div>
                        <label class="layui-form-label">标题</label>
                        <div class="layui-input-inline">
                            <input type="text" name="title"  id="title"  placeholder="请输入行程标题" autocomplete="off" class="layui-input" th:value="${routeJb.title}">
                        </div>
                        <label class="layui-form-label">状态</label>
                        <div class="layui-input-inline">
                            <select name="status" style="display: inline-block; width: 190px;height: 38px;">
                                <option value="0">请选择</option>
                                <option value="1" selected="true" th:if="${routeJb.status eq 1}" >待审核</option>
                                <option value="1" th:if="${routeJb.status ne 1}">待审核</option>
                                <option value="2" selected="true" th:if="${routeJb.status eq 2}">审核通过</option>
                                <option value="2" th:if="${routeJb.status ne 2}">审核通过</option>
                                <option value="3" selected="true" th:if="${routeJb.status eq 3}">审核不通过</option>
                                <option value="3" th:if="${routeJb.status ne 3}">审核不通过</option>
                            </select>
                        </div>
                        <div class="layui-input-inline" style="width:80px">
                            <button class="layui-btn" id="add"><i class="layui-icon">&#xe608;</i>查询</button>
                        </div>
                    </div>
                </div>
            </form>
            <table class="layui-table">
                <thead>
                    <tr>

                        <th>
                            商家ID
                        </th>
                        <th>
                            商家名称
                        </th>
                        <th>
                            标题
                        </th>
                        <th>
                            单价
                        </th>
                        <th>
                            创建时间
                        </th>
                        <th>
                            状态
                        </th>
                        <th>
                            查看
                        </th>
                        <th>
                            操作
                        </th>
                    </tr>
                </thead>
                <tbody id="x-link">
                    <tr th:each="emp : ${list}">
                        <input type="hidden" class="route-id" th:value="${emp.id}"/>
                        <td th:text="${emp.mId}">

                        </td>
                        <td th:text="${emp.proName}">

                        </td>
                        <td th:text="${emp.title}">
                            二当家的
                        </td>
                        <td th:text="${emp.price}+'￥'">
                            二当家的
                        </td>
                        <td th:text="${emp.stDate}">

                        </td>
                        <td class="route-status">
                            <span th:if="${emp.status eq 1}">待审核</span>
                            <span th:if="${emp.status eq 2}">审核通过</span>
                            <span th:if="${emp.status eq 3}">审核不通过</span>
                        </td>
                        <td id="ckxq">
                            <a target="view_xx" th:href="'/routeXx/toxxlist?id='+${emp.id}">查看详情</a>
                        </td>
                        <td class="td-manage">
                            <!--<a title="删除" href="#" onclick="commemt_del(this,)" class="delete"  th:dataid="${emp.id}"
                            style="text-decoration:none">
                                <i class="layui-icon">&#xe640;</i>
                            </a>-->
                            <select class="czSelect" name="status" style="display: inline-block; width: 150px;height: 38px;">
                                <option value="1" th:if="${emp.status eq 1}">点击操作</option>
                                <option value="1" th:if="${emp.status ne 1}">暂无操作</option>
                                <option value="2" th:if="${emp.status eq 1}">审核通过</option>
                                <option value="3" th:if="${emp.status eq 1}">审核不通过</option>
                            </select>

                        </td>

                    </tr>
                </tbody>
            </table>

            <div class="page-normal">
                <a class="page-prev" title="上一页"  th:if="${page.getCurrentPageNo() gt 1}" th:href="'/routeJb/houtailist?index=' + ${page.getCurrentPageNo() - 1}+'&mId='+${routeJb.mId}+'&title='+${routeJb.title}+'&status='+${routeJb.status}+'&proName='+${routeJb.proName}">&lt;</a>
                <!-- 数字1 代表当前页面-->
                <a class="page-current"th:href="'/routeJb/houtailist?index=1&mId='+${routeJb.mId}+'&title='+${routeJb.title}+'&status='+${routeJb.status}+'&proName='+${routeJb.proName}">首页</a>
                <a th:href="'/routeJb/houtailist?index='+${page.getTotalPageCount()}+'&mId='+${routeJb.mId}+'&title='+${routeJb.title}+'&status='+${routeJb.status}+'&proName='+${routeJb.proName}">尾页</a>
                <a title="下一页" th:if="${page.getCurrentPageNo() lt page.getTotalPageCount()}" th:href="'/routeJb/houtailist?index='+ ${page.getCurrentPageNo() + 1}+'&mId='+${routeJb.mId}+'&title='+${routeJb.title}+'&status='+${routeJb.status}+'&proName='+${routeJb.proName}" >&gt;</a>
                <a th:text="'第'+${page.getCurrentPageNo()}+'页/总页数'+${page.getTotalPageCount()}"></a>
            </div>
        </div>
        <script src="./lib/layui/layui.js" charset="utf-8"></script>
        <script src="./js/x-layui.js" charset="utf-8"> </script>
        <script type="text/javascript" src="./houtaistatic/js/ajax.js"></script>
        <script type="text/javascript" >
        $(function () {
            $(".czSelect").change(function () {
               var i= $(this).parent().parent().find(".route-id").val();
               var str=$(this).val();
               var czSele=$(this);
               var tas=$(this).parent().parent().find(".route-status");
                $.ajax({
                    type:"GET",//请求方式
                    url:"/routeJb/routelist-json",//请求路径
                    data:{id:i,status:str},//请求参数
                    dataType:"json",//返回数据类型
                    success:function (data) {
                        if(data==1){
                            czSele.html("<option value=1>暂无操作</option>");
                           // alert(czSele.html());
                            if(str==2){
                                tas.html("审核通过");
                            }else if(str==3){
                                tas.html("审核不通过");
                            }else{
                                alert("数据修改错误");
                                czSele.val(1);
                            }
                        }
                    },
                    error:function (data) {//当访问时候，404，500 等非200的错误状态码
                        alert("操作失败");
                    }

                });

            });
        });

        </script>
    </body>
</html>